/**
 * @author vivi
 * @description
 * @date 2024/5/28
 */
public class demo1 {
    public boolean solve (String A, String B) {
        // write code here
        if (A.length() != B.length()) return false;
        return (A + A).contains(B);
    }
}
